package org.skyer.third.gateway.api.constant.taobao;

import org.skyer.third.gateway.api.enums.CommonOrderRefundStatusEnum;
import org.skyer.third.gateway.api.enums.CommonOrderStatusEnum;

import java.util.HashMap;
import java.util.Map;


public class TaoBaoOrderStatusConstant {

    /**
    * 待发货
    */
    public static String WAIT_SELLER_SEND_GOODS="WAIT_SELLER_SEND_GOODS";
    
    /**
     * 部分发货
     */
    public static String SELLER_CONSIGNED_PART="SELLER_CONSIGNED_PART";
    /**
     * 已发货
     */
    public static String WAIT_BUYER_CONFIRM_GOODS="WAIT_BUYER_CONFIRM_GOODS";

    /**
     * 交易完成
     */
    public static String TRADE_BUYER_SIGNED="TRADE_BUYER_SIGNED";

    /**
     * 交易完成
     */
    public static String TRADE_FINISHED="TRADE_FINISHED";

    /**
     * 交易关闭
     */
    public static String TRADE_CLOSED="TRADE_CLOSED";

    /**
     * 交易关闭
     */
    public static String TRADE_CLOSED_BY_TAO_BAO="TRADE_CLOSED_BY_TAOBAO";



     /******  退款状态 ******/


    /**
     * 买家已经申请退款，等待卖家同意
     */
     public static String REFUND_TB_WAIT_SELLER_AGREE="WAIT_SELLER_AGREE";

    /**
     * 卖家已经同意退款，等待买家退货
     */
    public static String WAIT_BUYER_RETURN_GOODS="WAIT_BUYER_RETURN_GOODS";

    /**
     * 买家已经退货，等待卖家确认收货
     */
    public static String WAIT_SELLER_CONFIRM_GOODS="WAIT_SELLER_CONFIRM_GOODS";

    /**
     * 卖家拒绝退款
     */
    public static String SELLER_REFUSE_BUYER="SELLER_REFUSE_BUYER";

    /**
     * 退款关闭
     */
    public static String CLOSED="CLOSED";

    /**
     * 退款成功
     */
    public static String SUCCESS="SUCCESS";




    public final static Map<String, Integer> TAO_BAO_ORDER_STATUS_MAP = new HashMap() {
        {
            //20待发货
            put("WAIT_SELLER_SEND_GOODS", CommonOrderStatusEnum.TO_BE_SHIPPED.getCode());
            //40已发货
            put("WAIT_BUYER_CONFIRM_GOODS", CommonOrderStatusEnum.SHIPPED.getCode());
            //50交易完成
            put("TRADE_BUYER_SIGNED", CommonOrderStatusEnum.TRADE_SUCCESS.getCode());
            put("TRADE_FINISHED", CommonOrderStatusEnum.TRADE_SUCCESS.getCode());
            //60交易关闭
            put("TRADE_CLOSED", CommonOrderStatusEnum.TRADE_CLOSE.getCode());
            put("TRADE_CLOSED_BY_TAOBAO",  CommonOrderStatusEnum.TRADE_CLOSE.getCode());
        }
    };


    /**
     * 退款状态，默认查询所有退款状态的数据，除了默认值外每次只能查询一种状态。
     *  WAIT_SELLER_AGREE(买家已经申请退款，等待卖家同意)
     *  WAIT_BUYER_RETURN_GOODS(卖家已经同意退款，等待买家退货)
     *  WAIT_SELLER_CONFIRM_GOODS(买家已经退货，等待卖家确认收货)
     *  SELLER_REFUSE_BUYER(卖家拒绝退款) CLOSED(退款关闭) SUCCESS(退款成功)
     */
    public final static Map<String, Integer> TAO_BAO_ORDER_REFUND_STATUS_MAP = new HashMap() {
        {


            put("WAIT_SELLER_AGREE", CommonOrderRefundStatusEnum.REFUND.getCode());

            put("WAIT_BUYER_RETURN_GOODS", CommonOrderRefundStatusEnum.REFUND.getCode());

            put("WAIT_SELLER_CONFIRM_GOODS", CommonOrderRefundStatusEnum.REFUND.getCode());

            //put("SELLER_REFUSE_BUYER", CommonOrderStatusEnum.TRADE_SUCCESS.getCode());

            put("CLOSED", CommonOrderRefundStatusEnum.REFUND_CLOSE.getCode());

            put("SUCCESS",  CommonOrderRefundStatusEnum.REFUND_SUCCESS.getCode());
        }
    };
}
